package com.seveneight.baijiesteward.ui.first.presenter;

import android.content.Context;

import com.seveneight.baijiesteward.bean.ProfitBean;
import com.seveneight.baijiesteward.http.MyCallBack;
import com.seveneight.baijiesteward.ui.first.contract.ProfitContract;
import com.seveneight.baijiesteward.ui.first.model.ProfitModel;

import java.util.List;

import okhttp3.RequestBody;

/**
 * Created by user1 on 2018/4/4.
 */

public class ProfitPresenter implements ProfitContract.ProfitPresenter {

    ProfitContract.ProfitView profitView;
    ProfitContract.ProfitModel profitModel;

    public ProfitPresenter(ProfitContract.ProfitView profitView){
        this.profitView=profitView;
        profitModel=new ProfitModel();
    }

    @Override
    public void getProfitData(Context context, RequestBody body) {
        profitModel.getProfitData(context, body, new MyCallBack<List<ProfitBean>>() {
            @Override
            public void onSuccess(List<ProfitBean> profitBeans) {
                profitView.rebackProfitData(profitBeans);
            }

            @Override
            public void onFailed() {

            }
        });
    }
}
